import { Toast  } from "vant";
import cTitle from "components/title";

export default {
  data() {
    return {
        list: []
    };
  },

  components: {
    cTitle
  },
  activated() {
    console.log(localStorage.getItem("uid"),'uid')
    if(!localStorage.getItem("uid")){
        this.$router.push(this.fun.getUrl("member"));
        return
    }
    this.getData();
  },
  computed: {
   
  },
  methods: {
    priceList(id){
        this.$router.push(this.fun.getUrl("yunChangeList",{ id:id }));
    },
    amendprice(item){
        console.log(item,'gaijia')
        
        if(localStorage.getItem("uid")){
            $http.post("ZhengChengYc.shenfen", {
                uid: localStorage.getItem("uid")
            }).then((res) => {
                if (res.result == 1) {
                    this.$router.push(this.fun.getUrl("yunChangePrice",{ info: JSON.stringify(item) }));
                }else {
                    Toast(res.msg)
                }
              });
        }else {
            Toast('当前身份不能改价')
        }
       
    },
    getData(){
        $http.post("ZhengChengYc.gaijia_goods_list", {}, "加载中").then((res) => {
            if (res.result == 1) {
              console.log(res,'gaijia_goods_list')
              this.list = res.data;
            }
          });
    },
    
  }
};
